package com.andyage.admin.action;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.andyage.admin.service.IMenuService;

@Controller
@RequestMapping("/admin")
public class MenuAction {
	@Resource
	private IMenuService imenuService;
	@RequestMapping("/queryMenuDetailsInfo")
	public void queryMenuDetailsInfo(HttpServletResponse response,HttpServletRequest request) {
		try {
			//String staffId=(String) request.getSession().getAttribute("AccountId");
			String roleId=request.getParameter("roleId");
			String json=imenuService.queryMenuDetailsInfo(roleId);
			response.setContentType("text/html;charset=utf-8");
			response.getWriter().print(json);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	@RequestMapping("/queryMenuByStaffId")
	public void queryMenuByStaffId(HttpServletResponse response,HttpServletRequest request) throws Exception {
		// TODO Auto-generated method stub
		String staffId=request.getParameter("staffId");
		String json=imenuService.queryMenuByStaffId(staffId);
		response.setContentType("text/html;charset=utf-8");
		response.getWriter().print(json);
	}
}
